import { ref } from 'vue'
import { getUserInfoApi } from '@/services/user'
import type { UserInfo } from '@/types/user'

export function userInfo() {
  const userInfoData = ref<UserInfo>()
  async function getUserInfo() {
    try {
      const { data } = await getUserInfoApi()
      userInfoData.value = data
    } catch (error) {
      console.log(error)
    }
  }
  return {
    userInfoData,
    getUserInfo
  }
}
